﻿package com.fandy.struts.DAL;

import java.sql.ResultSet;
import java.sql.SQLException;

import com.fandy.struts.SqlAccess.SqlServerHelper;
import com.fandy.struts.SqlStatement.Response;


public class DALResponse {
 
 
 SqlServerHelper ssh = new SqlServerHelper();
 Response r = new Response();
 
 
	public   ResultSet  getAll()
	{
		return  ssh.executeScalar(r.getAll()) ;
	}
	
	public   ResultSet getInfoByID(int ID)
	{
		return  ssh.executeScalar(r.getInfoByID(ID));
	}
	
	
	public int Add(com.fandy.struts.Model.Response res) throws SQLException
	{
		
		return   ssh.executeNoQuery(this.r.Add(res));
	}
	
	
	
//	public String UpdateByID(int id,com.fandy.struts.Model.Response s)
//	{
//		
//		return "update GoodsInfo set "+com.fandy.struts.Meta.Response.getClientid()
//		+"='" + s.getClientid()+"',"		 
//		+com.fandy.struts.Meta.Response.getClientname()+"='" +s.getClientname()+"',"
//		+com.fandy.struts.Meta.Response.getDate()+ "='"  + s.getDate() + "',"
//		+com.fandy.struts.Meta.Response.getGoodsname()+ "='"  + s.getGoodsname() + "',"
//		+com.fandy.struts.Meta.Response.getImage() + "='"  + s.getImage() + "',"
//		+com.fandy.struts.Meta.Response.getMessage()() + "='"  + s.getMessage() + "',"
//		+com.fandy.struts.Meta.Response.getRemsg() + "='"  + s.getRemsg()+ "'"
//		+com.fandy.struts.Meta.Response.getRemsg() + "='"  + s.getRemsg()+ "'"
//		+com.fandy.struts.Meta.Response.getRemsg() + "='"  + s.getRemsg()+ "'"
//		+"where "+com.fandy.struts.Meta.Response.getResponseid()+"="+id;
//		
//	}
	
	
//	public String DeleteByID(int id)
//	{
//		
//		return "delete from Response where " + com.fandy.struts.Meta.Response.get() +"="+id;
//		
//	}
	
	
	
}

